#include "smg.h"
#include "init.h"

code unsigned char Seg_Table[] = 
{
0xc0, //0
0xf9, //1
0xa4, //2
0xb0, //3
0x99, //4
0x92, //5
0x82, //6
0xf8, //7
0x80, //8
0x90, //9
0x88, //A
0x83, //b
0xc6, //C
0xa1, //d
0x86, //E
0x8e, //F
0x00	
};


void SMG_Bit(unsigned char pos,unsigned char dat,unsigned char point)
{
	P0 = 0xff;
	P2 = P2 & 0x1f | 0xe0;
	P2 &= 0x1f;
	
	InitHC573(7);
	P0 = Seg_Table[dat];
	if(point == 1)
		P0 &= 0x7f;

	InitHC573(0);
	InitHC573(6);
	P0 = 0x01<<pos;

	InitHC573(0);
	
}